home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17213 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.4 KB

  1. Path: igoodwin.demon.co.uk!ian
  2. From: Ian Goodwin <ian@igoodwin.demon.co.uk>
  3. Newsgroups: comp.lang.c++
  4. Subject: MS Visual C++ - DRAWCLI Example - Attempting to Use DrawText
  5. Date: Sun, 14 Apr 1996 16:07:07 +0100
  6. Organization: Parallel Database Technologies Ltd
  7. Distribution: world
  8. Message-ID: <59t$zCAbSRcxEwJW@igoodwin.demon.co.uk>
  9. NNTP-Posting-Host: igoodwin.demon.co.uk
  10. X-NNTP-Posting-Host: igoodwin.demon.co.uk
  11. MIME-Version: 1.0
  12. X-Newsreader: Turnpike Version 1.12 <dXgF3jj$H5JqyL$ROhciZFzKCM>
  13.  
  14. Hello World ;-)
  15.  
  16.  
  17. I am trying to knock up a quick prototype, and I was attempting to use
  18. the Drawcli example application. I want to display some text, only it
  19. doesn't show.
  20.  
  21. I've tried DrawText, TextOut ExtTextOut etc.
  22.  
  23. The TextColor is set to Black, and I have tried explictily loading a
  24. stock object, and to reset the font.
  25.  
  26. I am Obviuosly missing something,.... can someone please point out my
  27. mistake...
  28.  
  29.  
  30.                 COLORREF cRef;
  31.                 COLORREF cBack;
  32.                 HFONT hFont;
  33.  
  34.                 hFont = (HFONT) SendMessage( (HWND) AfxGetMainWnd(),
  35. WM_GETFONT,0,0L);
  36.  
  37.                 pDC->Rectangle(rect);
  38.                 pDC->Ellipse(rect);
  39.                 cRef = pDC->GetTextColor();
  40.                 cBack = pDC->GetBkColor();
  41.                 hFont = (HFONT) GetStockObject(SYSTEM_FONT);
  42.                 pDC->DrawText( _T("Work, please....."), 12, rect,
  43. DT_LEFT );
  44.  
  45.  
  46.  
  47. Regards  Ian G.
  48.